# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=nox
pkgname=python-$_pkgname
pkgver=2022.11.21
pkgrel=2
pkgdesc='Flexible test automation for Python'
arch=('any')
url='https://github.com/wntrblm/nox'
license=('Apache')
depends=('python' 'python-argcomplete' 'python-colorlog' 'python-py' 'python-virtualenv' 'python-packaging')
optdepends=('python-jinja: tox_to_nox'
            'python-tox: tox_to_nox')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest-runner' 'python-jinja' 'python-tox')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('7f725425acd7d1ef55e04c5330c1f4fd2f2f5107c24b4bb7f7e2711cf6a5c1b8f2777a4902ee31d4a56898a953f3da6a9ed340d652fbc63cba33f5f763702b78')

build() {
  cd $_pkgname-$pkgver

  python -m build -nw
}

check() {
  cd $_pkgname-$pkgver

# tox 4 isn't supported https://github.com/wntrblm/nox/issues/673
  python -m pytest -k 'not test_tox_to_nox'
}

package() {
  cd $_pkgname-$pkgver

  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
